package lesson2.com.general;

import lesson2.com.animals.Animal;
import lesson2.com.animals.FlyingSquirrel;
import lesson2.com.marvel.Superman;

public class GeneralTester {

    public static void main(String[] args) {
        Animal a;

        Flyer f;
        //f = new Flyer();  // can't instantiate an interface, they have no constructors
        // they are NOT classes... they are interfaces

        f = new FlyingSquirrel(); // no problem, FlyingSquirrel implements Flyer
        if (f instanceof Animal) {
            a = (Animal) f;
            a.walk();
        }
        f.takeOff();
        f.fly();
        f.land();
        //f.walk(); // won't compile...... Flyers do not know to walk()
        f.toString(); // fine, everything (other than primitives) are descendants of java.lang.Object
        System.out.println("-----------");
        f = new Superman();
        f.takeOff();
        f.fly();
        f.land();
        
        
        //f = null;
        //f.takeOff();

        //int[] nums  = {76,23};
        //System.out.println(nums[5]);

    }
}
